﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CompositeModeStudy
{
    class Program
    {
        static void Main(string[] args)
        {
            //根节点 —— WindowForm
            Composite wf = new WindowForm();
            wf.SetTitle("WinForm(WINDOW窗口)");

            //叶子节点 —— picture
            Component pc = new Picture();
            pc.SetTitle("Picture(LOGO图片)");
            wf.add(pc);

            Component bt1 = new Button();
            bt1.SetTitle("Button(登录)");
            wf.add(bt1);

            Component bt2 = new Button();
            bt2.SetTitle("Button(注册)");
            wf.add(bt2);

            //Frame子树
            Composite fm = new Frame();
            fm.SetTitle("Frame(FRAME1)");
            wf.add(fm);

            //叶子节点 —— label(用户名)
            Component lb = new Label();
            lb.SetTitle("Lable(用户名)");
            fm.add(lb);

            Component tb = new TextBox();
            tb.SetTitle("TextBox(文本框)");
            fm.add(tb);

            Component lb2 = new Label();
            lb2.SetTitle("Lable(密码)");
            fm.add(lb2);

            Component pwb = new PasswordBox();
            pwb.SetTitle("PasswordBox(密码框)");
            fm.add(pwb);

            Component cb = new CheckBox();
            cb.SetTitle("CheckBox(复选框)");
            fm.add(cb);

            Component tb2 = new TextBox();
            tb2.SetTitle("TextBox(记住用户名)");
            fm.add(tb2);

            Component llb = new LinkLabel();
            llb.SetTitle("LinkLable(忘记密码)");
            fm.add(llb);

            //全场唯一一次打印
            wf.print();

            Console.ReadLine();
        }
    }
}
